<template>
  <div class="top">
    <div>
      <el-form :model="Searchform" label-width="120px">
        <el-form-item label="工单编号：">
          <el-input v-model="Searchform.name" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="工单状态:">
          <el-select v-model="Searchform.region" placeholder="请选择">
            <el-option label="待办" value="1" />
            <el-option label="进行" value="2" />
            <el-option label="取消" value="3" />
            <el-option label="完成" value="4" />
          </el-select>
          <el-button type="primary" @click="onSubmitSearch">查询</el-button>
        </el-form-item>

      </el-form>
    </div>
    <div class="conter">
      <el-button type="primary" color="#db3602" @click="centerDialogVisible = true">新建</el-button>
      <el-button type="warning" @click="GcenterDialogVisibleQ ">工单配置</el-button>
    </div>
    <!-- 表格项 -->
    <div class="bottom">
      <el-table :data="TaskList" style="width: 100%" @row-click="DeailItem">
        <el-table-column type=index label="序号" width="80" />
        <el-table-column prop="taskCode" label="工单编号" width="160" />
        <el-table-column prop="innerCode" label="设备编号" width="160" />
        <el-table-column prop="taskType.typeName" label="工单类型" width="160" />
        <el-table-column prop="createType" label="工单方式" width="130" />
        <el-table-column prop="taskStatusTypeEntity.statusName" label="工单状态" width="130" />
        <el-table-column prop="userName" label="运营人员" width="130" />
        <el-table-column prop="createTime" label="创建日期" width="130" />
        <el-table-column prop="operator" label="操作" width="130" />
      </el-table>
    </div>
    <!-- 基础查询分页 -->
    <div class="pagination" v-if="!Searchform.region&&!Searchform.name">
      <el-pagination background v-model:currentPage="currentPage4" layout="prev, pager, next" :total="+totalCount" @prev-click=getlist() @next-click=getlist() @current-change=getlist() />
    </div>
    <!-- 精准查询分页 -->
    <div class="pagination" v-else-if="Searchform.region">
      <el-pagination background v-model:currentPage="currentPage5" layout="prev, pager, next" :total="+totalCount1" @prev-click=onSubmitSearch() @next-click=onSubmitSearch() @current-change=onSubmitSearch() />
    </div>
    <div v-else>11</div>
  </div>
  <!-- 新增弹出框 -->
  <el-dialog v-model="centerDialogVisible" title="新增工单" width="40%" center>
    <el-form :model="Addform" label-width="120px">
      <el-form-item label="设备编号">
        <el-input v-model="Addform.innerCode" show-word-limit type="text" maxlength="15" size="large" :style="{  width: '600px'}" />
      </el-form-item>
      <el-form-item label="工单类型:">
        <el-select v-model="Addform.productType" placeholder="请选择" :style="{  width: '600px'}">
          <el-option label="补货工单" value=2 />
        </el-select>
      </el-form-item>
      <el-form-item label="补货数量:">
        <span class="iconfont icon-dingdanguanli" @click="BUHUOQINDAN">补货清单</span>
      </el-form-item>
      <el-form-item label="运营人员:">
        <el-select v-model="Addform.userId" placeholder="请选择" :style="{  width: '600px'}">
          <el-option :label="item.userName" :value="item.userId" v-for="item in Personinfo " :key="item.userId" />
        </el-select>
      </el-form-item>
      <el-form-item label="备注:">
        <el-input v-model="Addform.desc" :autosize="{ minRows: 6, maxRows: 4 }" maxlength="40" placeholder="请输入备注不超过40字" show-word-limit type="textarea" />

      </el-form-item>
      <el-form-item class="botton">
        <el-button type="warning" @click="centerDialogVisible=false">取消</el-button>
        <el-button color="#db3602" @click="onSubmitAddform">提交</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
  <!-- 工单配置弹出框 -->
  <el-dialog v-model="GcenterDialogVisible" title="工单配置" width="40%" center>
    <el-form-item label="补货警戒线:">
      <el-input-number v-model="goodnum" :min="1" :max="999" :style="{  width: '500px'}" />
    </el-form-item>
    <el-form-item class="botton1">
      <el-button type="warning" @click="GcenterDialogVisible=false">取消</el-button>
      <el-button color="#db3602" @click="onSubmitgoodnum">提交</el-button>
    </el-form-item>
  </el-dialog>
  <!-- 查看详情 -->
  <div>
    <el-dialog el-dialog v-model="GGGcenterDialogVisible" title="工单配置" width="40%" center style="margin-top: 15vh; width: 630px;">
      <div class="el-dialog__header"><span class="el-dialog__title">工单详情</span><button @click="GGGcenterDialogVisible=false" type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button></div>
      <div class="el-dialog__body">

        <div data-v-685a2475="" class="task-status">
          <div class="imgimg"><img data-v-685a2475="" :src="imgsrc"></div>
          <div class="quxiao"><span data-v-685a2475="" class="status">{{DetilList.taskStatusTypeEntity?.statusName}}</span></div>
          <div class="imgimgimg"><img data-v-685a2475="" :src="imgsrcright" class="pic"></div>
        </div>
        <form data-v-685a2475="" class="el-form">
          <div data-v-685a2475="" class="el-row">
            <div data-v-685a2475="" class="el-col el-col-12">
              <div data-v-685a2475="" class="el-form-item"><label class="el-form-item__label" style="width: 120px;">设备编号：</label>
                <div class="el-form-item__content" style="margin-left: 120px;">
                  {{DetilList.innerCode }}
                  <!---->
                </div>
              </div>
            </div>
            <div data-v-685a2475="" class="el-col el-col-12">
              <div data-v-685a2475="" class="el-form-item"><label class="el-form-item__label" style="width: 120px;">创建日期：</label>
                <div class="el-form-item__content" style="margin-left: 120px;">
                  {{DetilList.createTime}}
                  <!---->
                </div>
              </div>
            </div>
            <div data-v-685a2475="" class="el-col el-col-12">
              <div data-v-685a2475="" class="el-form-item"><label class="el-form-item__label" style="width: 120px;">取消日期：</label>
                <div class="el-form-item__content" style="margin-left: 120px;">
                  {{DetilList.updateTime}}
                  <!---->
                </div>
              </div>
            </div>
            <!---->
            <div data-v-685a2475="" class="el-col el-col-12">
              <div data-v-685a2475="" class="el-form-item"><label class="el-form-item__label" style="width: 120px;">运营人员：</label>
                <div class="el-form-item__content" style="margin-left: 120px;">
                  {{DetilList.userName}}
                  <!---->
                </div>
              </div>
            </div>
            <div data-v-685a2475="" class="el-col el-col-12">
              <div data-v-685a2475="" class="el-form-item"><label class="el-form-item__label" style="width: 120px;">工单类型：</label>
                <div class="el-form-item__content" style="margin-left: 120px;">
                  {{DetilList.taskType?.typeName}}
                  <!---->
                </div>
              </div>
            </div>
            <div data-v-685a2475="" class="el-col el-col-12">
              <div data-v-685a2475="" class="el-form-item"><label class="el-form-item__label" style="width: 120px;">补货数量：</label>
                <div class="el-form-item__content" style="margin-left: 120px;"><button data-v-9189b082="" data-v-685a2475="" type="button" class="el-button el-button--primary-text el-button--text">
                    <!---->
                    <!----><span @click="AddList(DetilList.taskId)">
                      补货详情
                    </span>
                  </button>
                  <!---->
                </div>
              </div>
            </div>
            <div data-v-685a2475="" class="el-col el-col-12">
              <div data-v-685a2475="" class="el-form-item"><label class="el-form-item__label" style="width: 120px;">工单方式：</label>
                <div class="el-form-item__content" style="margin-left: 120px;">
                  {{DetilList.createType}}
                  <!---->
                </div>
              </div>
            </div>
            <div data-v-685a2475="" class="el-col el-col-12">
              <div data-v-685a2475="" class="el-form-item"><label class="el-form-item__label" style="width: 120px;">取消原因：</label>
                <div class="el-form-item__content" style="margin-left: 120px;">
                  <div data-v-685a2475="" class="desc">

                  </div>
                  <!---->
                </div>
              </div>
            </div>
            <!---->
          </div>
        </form>
        <div data-v-685a2475="" class="el-dialog__wrapper" style="display: none;">
          <div role="dialog" aria-modal="true" aria-label="补货详情" class="el-dialog" style="margin-top: 15vh; width: 630px;">
            <div class="el-dialog__header"><span class="el-dialog__title">补货详情</span>
              <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button>
            </div>

            <!---->
            <!---->
          </div>
        </div>
      </div>
      <div class="el-dialog__footer">
        <div data-v-685a2475="" class="dialog-footer"><button v-if="nowtask==='取消'" @click="reload(DetilList)" data-v-7a3ae0e4="" data-v-685a2475="" type="button" class="el-button el-button--secondary el-button--primary">
            <!---->
            <!----><span>
              重新创建
            </span>
          </button>
          <button v-else-if="nowtask==='待办'" @click="reloadd(DetilList)" data-v-7a3ae0e4="" data-v-685a2475="" type="button" class="el-button el-button--secondary el-button--primary">
            <!---->
            <!----><span>
              取消工单
            </span>
          </button>
        </div>
      </div>
    </el-dialog>
  </div>
  <!-- 套中套列表 -->
  <el-dialog v-model="TAOTAOTAO">
    <div role="dialog" aria-modal="true" aria-label="补货详情" class="el-dialog" style="margin-top: 15vh; width: 630px;">
      <div class="el-dialog__header"><span class="el-dialog__title">补货详情</span><button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button></div>
      <div class="el-dialog__body">
        <div class="scrollbar el-scrollbar" style="height: 330px;">
          <div class="el-scrollbar__wrap" style="margin-bottom: -17px; margin-right: -17px;">
            <div class="el-scrollbar__view">
              <div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" style="width: 552px; margin: 0px auto;">
                <div class="hidden-columns">
                  <div></div>
                  <div></div>
                  <div></div>
                </div>
                <div class="el-table__header-wrapper">
                  <table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 552px;">
                    <colgroup>
                      <col name="el-table_2_column_10" width="184">
                      <col name="el-table_2_column_11" width="184">
                      <col name="el-table_2_column_12" width="184">
                      <col name="gutter" width="0">
                    </colgroup>
                    <thead class="has-gutter">
                      <tr class="">
                        <th colspan="1" rowspan="1" class="el-table_2_column_10     is-leaf" style="line-height: 1.15; padding: 10px 0px 9px; background: rgb(243, 246, 251); font-weight: 500; text-align: left; color: rgb(102, 102, 102);">
                          <div class="cell">货道编号</div>
                        </th>
                        <th colspan="1" rowspan="1" class="el-table_2_column_11     is-leaf" style="line-height: 1.15; padding: 10px 0px 9px; background: rgb(243, 246, 251); font-weight: 500; text-align: left; color: rgb(102, 102, 102);">
                          <div class="cell">商品</div>
                        </th>
                        <th colspan="1" rowspan="1" class="el-table_2_column_12     is-leaf" style="line-height: 1.15; padding: 10px 0px 9px; background: rgb(243, 246, 251); font-weight: 500; text-align: left; color: rgb(102, 102, 102);">
                          <div class="cell">补货数量</div>
                        </th>
                        <th class="gutter" style="width: 0px; display: none;"></th>
                      </tr>
                    </thead>
                  </table>
                </div>
                <div class="el-table__body-wrapper is-scrolling-none">
                  <table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 552px;">
                    <colgroup>
                      <col name="el-table_2_column_10" width="184">
                      <col name="el-table_2_column_11" width="184">
                      <col name="el-table_2_column_12" width="184">
                    </colgroup>
                    <tbody>
                      <tr class="el-table__row" v-for="good in GoodListinfo" :key="good.detailsId">
                        <td rowspan="1" colspan="1" class="el-table_2_column_10  " style="height: 44px; padding: 2px 0px; text-align: left; color: rgb(102, 102, 102);">
                          <div class="cell">
                            {{good.channelCode}}
                          </div>
                        </td>
                        <td rowspan="1" colspan="1" class="el-table_2_column_11  " style="height: 44px; padding: 2px 0px; text-align: left; color: rgb(102, 102, 102);">
                          <div class="cell">
                            {{good.skuName}}
                          </div>
                        </td>
                        <td rowspan="1" colspan="1" class="el-table_2_column_12  " style="height: 44px; padding: 2px 0px; text-align: left; color: rgb(102, 102, 102);">
                          <div class="cell">
                            {{good.expectCapacity}}
                          </div>
                        </td>
                      </tr>
                      <!---->
                    </tbody>
                  </table>
                  <!---->
                  <!---->
                </div>
                <!---->
                <!---->
                <!---->
                <!---->
                <div class="el-table__column-resize-proxy" style="display: none;"></div>
              </div>
            </div>
          </div>
          <div class="el-scrollbar__bar is-horizontal">
            <div class="el-scrollbar__thumb" style="transform: translateX(0%);"></div>
          </div>
          <div class="el-scrollbar__bar is-vertical">
            <div class="el-scrollbar__thumb" style="transform: translateY(0%); height: 47.0085%;"></div>
          </div>
        </div>
      </div>
      <!---->
    </div>
  </el-dialog>
  <!-- 确认取消弹框 -->
  <el-dialog v-model="TrueOrFalse" title="取消工单" width="30%" center>
    <span>确认取消此工单麽</span>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="TrueOrFalse = false">取消</el-button>
        <el-button type="primary" @click="Truetrak">确认</el-button>
      </span>
    </template>
  </el-dialog>
  <!-- 添加补货清单v-model="GOODSLIST" -->
  <el-dialog v-model="GOODSLIST">
    <div data-v-2208183a="" class="el-dialog__wrapper" style="z-index: 2027;">
      <div role="dialog" aria-modal="true" aria-label="补货详情" class="el-dialog" style="margin-top: 15vh; width: 630px;">
        <div class="el-dialog__header"><span class="el-dialog__title">补货详情</span><button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button></div>
        <div class="el-dialog__body">
          <div class="scrollbar el-scrollbar" style="height: 330px;">
            <div class="el-scrollbar__wrap" style="margin-bottom: -17px; margin-right: -17px;">
              <div class="el-scrollbar__view">
                <div class="el-table el-table--fit el-table--enable-row-hover" style="width: 568px; margin: 0px auto;">
                  <div class="hidden-columns">
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                  </div>
                  <div class="el-table__header-wrapper">
                    <table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 568px;">
                      <colgroup>
                        <col name="el-table_4_column_24" width="92">
                        <col name="el-table_4_column_25" width="92">
                        <col name="el-table_4_column_26" width="92">
                        <col name="el-table_4_column_27" width="92">
                        <col name="el-table_4_column_28" width="200">
                        <col name="gutter" width="0">
                      </colgroup>
                      <thead class="has-gutter">
                        <tr class="">
                          <th colspan="1" rowspan="1" class="el-table_4_column_24     is-leaf" style="line-height: 1.15; padding: 10px 0px 9px; background: rgb(243, 246, 251); font-weight: 500; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">货道编号</div>
                          </th>
                          <th colspan="1" rowspan="1" class="el-table_4_column_25     is-leaf" style="line-height: 1.15; padding: 10px 0px 9px; background: rgb(243, 246, 251); font-weight: 500; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">商品名称</div>
                          </th>
                          <th colspan="1" rowspan="1" class="el-table_4_column_26     is-leaf" style="line-height: 1.15; padding: 10px 0px 9px; background: rgb(243, 246, 251); font-weight: 500; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">当前数量</div>
                          </th>
                          <th colspan="1" rowspan="1" class="el-table_4_column_27     is-leaf" style="line-height: 1.15; padding: 10px 0px 9px; background: rgb(243, 246, 251); font-weight: 500; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">还可添加</div>
                          </th>
                          <th colspan="1" rowspan="1" class="el-table_4_column_28     is-leaf" style="line-height: 1.15; padding: 10px 0px 9px; background: rgb(243, 246, 251); font-weight: 500; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">补满数量</div>
                          </th>
                          <th class="gutter" style="width: 0px; display: none;"></th>
                        </tr>
                      </thead>
                    </table>
                  </div>
                  <div class="el-table__body-wrapper is-scrolling-none">
                    <table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 568px;">
                      <colgroup>
                        <col name="el-table_4_column_24" width="92">
                        <col name="el-table_4_column_25" width="92">
                        <col name="el-table_4_column_26" width="92">
                        <col name="el-table_4_column_27" width="92">
                        <col name="el-table_4_column_28" width="200">
                      </colgroup>
                      <tbody>
                        <tr class="el-table__row" v-for="(goods,index) in  GoodListinfoinfo" :key="goods.channelId">
                          <td rowspan="1" colspan="1" class="el-table_4_column_24  " style="height: 44px; padding: 2px 0px; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">
                              {{goods.channelCode}}
                            </div>
                          </td>
                          <td rowspan="1" colspan="1" class="el-table_4_column_25  " style="height: 44px; padding: 2px 0px; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">
                              {{goods.sku?.brandName}}
                            </div>
                          </td>
                          <td rowspan="1" colspan="1" class="el-table_4_column_26  " style="height: 44px; padding: 2px 0px; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">
                              {{goods.currentCapacity}}
                            </div>
                          </td>
                          <td rowspan="1" colspan="1" class="el-table_4_column_27  " style="height: 44px; padding: 2px 0px; text-align: left; color: rgb(102, 102, 102);">
                            <div class="cell">
                              {{goods.maxCapacity}}
                            </div>
                          </td>
                          <td rowspan="1" colspan="1" class="el-table_4_column_28  " style="height: 44px; padding: 2px 0px; text-align: left; color: rgb(102, 102, 102);">
                            <el-input-number v-model="goods.maxCapacity" :min="1" :max="10" :style="{  width: '100px'}" />
                          </td>
                        </tr>
                        <!---->
                      </tbody>
                    </table>
                    <!---->
                    <!---->
                  </div>
                  <!---->
                  <!---->
                  <!---->
                  <!---->
                  <div class="el-table__column-resize-proxy" style="display: none;"></div>
                </div>
              </div>
            </div>
            <div class="el-scrollbar__bar is-horizontal">
              <div class="el-scrollbar__thumb" style="transform: translateX(0%);"></div>
            </div>
            <div class="el-scrollbar__bar is-vertical">
              <div class="el-scrollbar__thumb" style="transform: translateY(30.303%); height: 7.41906%;"></div>
            </div>
          </div>
        </div>
        <div class="el-dialog__footer">
          <div class="dialog-footer"><button @click="GOODSLIST = false" data-v-7a3ae0e4="" type="button" class="el-button el-button--secondary el-button--primary">
              <!---->
              <!----><span>
                取消
              </span>
            </button><button @click="TrueGoods" data-v-0eafa14e="" type="button" class="el-button el-button--primary1 el-button--primary">
              <!---->
              <!----><span>
                确认
              </span>
            </button></div>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script setup lang="ts">
import type {
  SearchList,
  GoodList,
  IPersonList,
  IAddTrsk,
  IGoodINFOINFO,
} from "../type";
import {
  GetSearch,
  GetDeilList,
  GetGoodList,
  GETCordon,
  SETCordon,
  PersonList,
  CreateTask,
  RemoveTask,
  SearchTaskinfo,
  GoodinnerCode,
  SearchtaskCode,
} from "@/api/task";
import { ElMessage } from "element-plus";
import { ElNotification } from "element-plus";
import { reactive, computed } from "vue";
import { ref } from "vue";
const centerDialogVisible = ref(false);
const GOODSLIST = ref(false);
const GOODINFO = ref(10);
const GGGcenterDialogVisible = ref(false);
const GcenterDialogVisible = ref(false);
const TAOTAOTAO = ref(false);
const TrueOrFalse = ref(false);
const totalCount = ref(0);
const totalCount1 = ref(0);
const currentPage4 = ref(1);
const currentPage5 = ref(1);
const taskId = ref("");
const desc = ref("");
const tskid = ref("");
const goodnum = ref(1);
const TaskList = ref<SearchList[]>([]);
const DetilList = ref<SearchList>({});
const GoodListinfo = ref<GoodList[]>([]);
const GoodListinfoinfo = ref<IGoodINFOINFO[]>([]);
const Personinfo = ref<IPersonList[]>([]);
const Searchform = reactive({
  name: "",
  region: "",
});
const Addform = reactive<IAddTrsk>({
  innerCode: "",
  productType: 2,
  userId: 8,
  desc: "",
  createType: 1,
  assignorId: 0,
  details: [],
});
const nowtask = ref("");
const onSubmitSearch = async () => {
  console.log(Searchform.region);
  if (!Searchform.name && Searchform.region !== "") {
    let res = await SearchTaskinfo(+Searchform.region, +currentPage5.value);
    console.log(res);
    res.currentPageRecords.forEach((element) => {
      if (element.createType === 1) {
        element.createType = "手动";
      } else {
        element.createType = "自动";
      }
      element.operator = "查看详情";
    });
    totalCount1.value = +res.totalCount;
    TaskList.value = res.currentPageRecords;
  } else if (Searchform.name !== "" && !Searchform.region) {
    let res = await SearchtaskCode(+Searchform.name);
    res.currentPageRecords.forEach((element) => {
      if (element.createType === 1) {
        element.createType = "手动";
      } else {
        element.createType = "自动";
      }
      element.operator = "查看详情";
    });
    totalCount1.value = +res.totalCount;
    TaskList.value = res.currentPageRecords;
  }
};
const onSubmitAddform = async () => {
  console.log(Addform);
  try {
    let CreateTaskres = await CreateTask(Addform);
    console.log(CreateTaskres);
    centerDialogVisible.value = false;
  } catch (error) {
    alert(error.response.data);
  }
};
const onSubmitgoodnum = () => {
  console.log(goodnum.value);
  SETCordon(goodnum.value);
  GcenterDialogVisible.value = false;
};

const getlist = async () => {
  let res = await GetSearch(currentPage4.value, 10, false);
  res.currentPageRecords.forEach((element) => {
    if (element.createType === 1) {
      element.createType = "手动";
    } else {
      element.createType = "自动";
    }
    element.operator = "查看详情";
  });
  totalCount.value = +res.totalCount;
  TaskList.value = res.currentPageRecords;
};

getlist();
const DeailItem = async (e: SearchList) => {
  console.log(e.taskId);
  nowtask.value = e.taskStatusTypeEntity.statusName;
  Addform.assignorId = e.assignorId as number;
  GGGcenterDialogVisible.value = true;
  let res = await GetDeilList(e.taskId);
  tskid.value = e.taskId as string;
  if (res.createType === 1) {
    res.createType = "手动";
  } else {
    res.createType = "自动";
  }

  DetilList.value = res;
};
const AddList = async (taskId: string) => {
  GGGcenterDialogVisible.value = false;
  TAOTAOTAO.value = true;
  let res: GoodList = await GetGoodList(taskId);
  console.log(res);
  GoodListinfo.value = res;
};
const GcenterDialogVisibleQ = async () => {
  GcenterDialogVisible.value = true;
  let res: number = await GETCordon();
  goodnum.value = res;
};
const reload = async (DetilList: SearchList) => {
  centerDialogVisible.value = true;
  console.log(DetilList);
  let res = await PersonList(DetilList.innerCode as string);
  let detailsres = await GetGoodList(tskid.value);
  Personinfo.value = res;
  Addform.details = detailsres;
  Addform.innerCode = DetilList.innerCode as string;
  Addform.region = DetilList.taskType?.typeName as string;
  Addform.userId = DetilList.userId as number;

  GGGcenterDialogVisible.value = false;
};
const reloadd = (DetilList: SearchList) => {
  console.log(DetilList.taskId);
  taskId.value = DetilList.taskId as string;
  desc.value = DetilList.desc as string;
  TrueOrFalse.value = true;
  GGGcenterDialogVisible.value = false;
};
const Truetrak = () => {
  RemoveTask(taskId.value, desc.value);
  getlist();
  TrueOrFalse.value = false;
};
const TrueGoods = async () => {
  GOODSLIST.value = false;
};

const BUHUOQINDAN = async () => {
  GOODSLIST.value = true;
  let res = await GoodinnerCode(Addform.innerCode);
  GoodListinfoinfo.value = res.filter((element) => element.sku);

  console.log(GoodListinfoinfo.value);
};
const imgsrc = computed(() => {
  if (nowtask.value === "待办") {
    return "";
  } else if (nowtask.value === "取消") {
    return "";
  } else {
    return "";
  }
});
const imgsrcright = computed(() => {
  if (nowtask.value === "待办") {
    return "http://likede2-admin.itheima.net/img/pic_1.834b274c.png";
  } else if (nowtask.value === "取消") {
    return "http://likede2-admin.itheima.net/img/pic_3.e8208e34.png";
  } else {
    return "http://likede2-admin.itheima.net/img/pic_4.3b5af41c.png";
  }
});
</script>
<style lang="less" scoped>
.dialog-footer button:first-child {
  margin-right: 10px;
}
.dialog-footer button:first-child {
  margin-right: 10px;
}
.imgimg {
  margin-left: 43px;
  margin-bottom: -68px;
}
.imgimgimg {
  margin-left: 230px;
}
.iconfont {
  color: blue;
}
.pagination {
  width: 100%;
  height: 10vh;
  margin-top: 20px;
  margin-left: 300px;
}
.top {
  margin-top: -15px;
  margin-left: -70px;
  .el-form {
    display: flex;
  }
  .el-button {
    margin-left: 10px;
  }
  .conter {
    margin-left: 30px;
    margin-top: 30px;
    .el-button {
      border: 0;
    }
  }
}
.botton {
  margin-left: 110px;
}
.bottom {
  margin-left: 70px;
  margin-top: 25px;
}
.botton1 {
  margin-left: 230px;
}
.quxiao {
  position: absolute;
  top: 163px;
  left: 49px;
}
</style>